<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The DateTimeZone class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.wakeup.html">DateTime::__wakeup</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div>
 <div class="up"><a href="book.datetime.html">Date/Time</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.datetimezone" class="reference">

 <h1 class="title">The DateTimeZone class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.2.0)</p>


  <div class="section" id="datetimezone.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    Representation of time zone.
   </p>
  </div>


  <div class="section" id="datetimezone.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">DateTimeZone</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.africa"><var class="varname">AFRICA</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.america"><var class="varname">AMERICA</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.antarctica"><var class="varname">ANTARCTICA</var></a></var>
     <span class="initializer"> = 4</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.arctic"><var class="varname">ARCTIC</var></a></var>
     <span class="initializer"> = 8</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.asia"><var class="varname">ASIA</var></a></var>
     <span class="initializer"> = 16</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.atlantic"><var class="varname">ATLANTIC</var></a></var>
     <span class="initializer"> = 32</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.australia"><var class="varname">AUSTRALIA</var></a></var>
     <span class="initializer"> = 64</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.europe"><var class="varname">EUROPE</var></a></var>
     <span class="initializer"> = 128</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.indian"><var class="varname">INDIAN</var></a></var>
     <span class="initializer"> = 256</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.pacific"><var class="varname">PACIFIC</var></a></var>
     <span class="initializer"> = 512</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.utc"><var class="varname">UTC</var></a></var>
     <span class="initializer"> = 1024</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.all"><var class="varname">ALL</var></a></var>
     <span class="initializer"> = 2047</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.all-with-bc"><var class="varname">ALL_WITH_BC</var></a></var>
     <span class="initializer"> = 4095</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.datetimezone.html#datetimezone.constants.per-country"><var class="varname">PER_COUNTRY</var></a></var>
     <span class="initializer"> = 4096</span>
    ;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="datetimezone.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$timezone</code></span>
   )</div>

    
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="datetimezone.getlocation.html" class="methodname">getLocation</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="datetimezone.getname.html" class="methodname">getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><a href="datetimezone.getoffset.html" class="methodname">getOffset</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.datetime.html" class="type DateTime">DateTime</a></span> <code class="parameter">$datetime</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="datetimezone.gettransitions.html" class="methodname">getTransitions</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$timestamp_begin</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timestamp_end</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">array</span> <span class="methodname"><a href="datetimezone.listabbreviations.html" class="methodname">listAbbreviations</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">array</span> <span class="methodname"><a href="datetimezone.listidentifiers.html" class="methodname">listIdentifiers</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$what</code><span class="initializer"> = DateTimeZone::ALL</span></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$country</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
  ]] )</div>


   }</div>


  </div>
  

  <div class="section" id="datetimezone.constants">
   <h2 class="title">Predefined Constants</h2>
   <dl>

    
     <dt id="datetimezone.constants.africa"><strong><code>DateTimeZone::AFRICA</code></strong></dt>

     <dd>

      <p class="para">Africa time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.america"><strong><code>DateTimeZone::AMERICA</code></strong></dt>

     <dd>

      <p class="para">America time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.antarctica"><strong><code>DateTimeZone::ANTARCTICA</code></strong></dt>

     <dd>

      <p class="para">Antarctica time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.arctic"><strong><code>DateTimeZone::ARCTIC</code></strong></dt>

     <dd>

      <p class="para">Arctic time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.asia"><strong><code>DateTimeZone::ASIA</code></strong></dt>

     <dd>

      <p class="para">Asia time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.atlantic"><strong><code>DateTimeZone::ATLANTIC</code></strong></dt>

     <dd>

      <p class="para">Atlantic time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.australia"><strong><code>DateTimeZone::AUSTRALIA</code></strong></dt>

     <dd>

      <p class="para">Australia time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.europe"><strong><code>DateTimeZone::EUROPE</code></strong></dt>

     <dd>

      <p class="para">Europe time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.indian"><strong><code>DateTimeZone::INDIAN</code></strong></dt>

     <dd>

      <p class="para">Indian time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.pacific"><strong><code>DateTimeZone::PACIFIC</code></strong></dt>

     <dd>

      <p class="para">Pacific time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.utc"><strong><code>DateTimeZone::UTC</code></strong></dt>

     <dd>

      <p class="para">UTC time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.all"><strong><code>DateTimeZone::ALL</code></strong></dt>

     <dd>

      <p class="para">All time zones.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.all-with-bc"><strong><code>DateTimeZone::ALL_WITH_BC</code></strong></dt>

     <dd>

      <p class="para">All time zones including backwards compatible.</p>
     </dd>

    

    
     <dt id="datetimezone.constants.per-country"><strong><code>DateTimeZone::PER_COUNTRY</code></strong></dt>

     <dd>

      <p class="para">Time zones per country.</p>
     </dd>

    

   </dl>

  </div>



 </div>

 


















































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="datetimezone.construct.html">DateTimeZone::__construct</a> — Creates new DateTimeZone object</li><li><a href="datetimezone.getlocation.html">DateTimeZone::getLocation</a> — Returns location information for a timezone</li><li><a href="datetimezone.getname.html">DateTimeZone::getName</a> — Returns the name of the timezone</li><li><a href="datetimezone.getoffset.html">DateTimeZone::getOffset</a> — Returns the timezone offset from GMT</li><li><a href="datetimezone.gettransitions.html">DateTimeZone::getTransitions</a> — Returns all transitions for the timezone</li><li><a href="datetimezone.listabbreviations.html">DateTimeZone::listAbbreviations</a> — Returns associative array containing dst, offset and the timezone name</li><li><a href="datetimezone.listidentifiers.html">DateTimeZone::listIdentifiers</a> — Returns a numerically indexed array containing all defined timezone identifiers</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.wakeup.html">DateTime::__wakeup</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div>
 <div class="up"><a href="book.datetime.html">Date/Time</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
